<?php
/* $Id: admin.php 695 2008-08-27 00:07:50Z enrico $ */

require_once "application/logic/users/admin/Admin.class.php";

/* Sitzung starten */
if ( !isset($_SESSION) ) session_start();

$admin_class = new Admin();

switch ( $_REQUEST["p"] ) {

	case "show_authors"	:{
					$admin_class->admin_show_list( "authors", "author_list_html", 
						$_REQUEST["tools"], $_REQUEST["author_id"] );			
					break;
				}
	case "edit_membership"	:{
					$admin_class->admin_edit_authors_membership( 
						$_REQUEST["author_id"], $_REQUEST["option"], $_REQUEST["project"],
						$_REQUEST["role"] 
					);
					break;
				}
	case "edit_accounthead" :{
					$accountoption = "";

					if ( isset($_REQUEST["account_save"]) || isset($_REQUEST["account_remove"]) ) {

						if ( isset($_REQUEST["account_save"]) ) {
							$accountoption = "save";
				
						}	else if ( isset($_REQUEST["account_remove"]) ) {
								$accountoption = "remove";
							} 
					}

					if ($accountoption != "" ) {
						$admin_class->admin_edit_authors_accounthead( $_REQUEST["author_id"], 
						$accountoption, $_REQUEST["author_name"], $_REQUEST["author_email"] );
					}

					break;
				}
	case "add_new_author"	: {

					$admin_class->admin_add_new_author();
					break;

				}

	case "show_projects"	: {
					$admin_class->admin_show_list( "projects", "project_list_html", 
						$_REQUEST["tools"], $_REQUEST["project_id"] );
	
					break;

				}

	case "add_new_project"	: {

					$admin_class->admin_add_new_project();
					break;

				}

	case "edit_project" :{
					$option = "";

					if ( isset($_REQUEST["save"]) || isset($_REQUEST["remove"]) ) {

						if ( isset($_REQUEST["save"]) ) {
							$option = "save";
				
						}	else if ( isset($_REQUEST["remove"]) ) {
								$option = "remove";
							} 
					}

					if ($option != "" ) {

						$admin_class->admin_edit_table_row_by_id( $_REQUEST["id"], $option, $_SERVER[ "QUERY_STRING" ] );

						//$admin_class->admin_edit_project( $_REQUEST["project_id"], 
						//	$option, $_REQUEST["project_name"], $_REQUEST["project_description_short"] );
					}

					break;
				}


	case "reset"		: {
					$admin_class->admin_reset_tables();
		
				}

		default		:{
					
				}			   

}

$admin_class->admin_show();

?>